next up previous contents index
Next: Free_Ldt_Descriptor Up: Functions and Procedures Previous: set_pm_interrupt

Allocate_Ldt_Descriptors

   

Declaration:

Function Allocate_Ldt_Descriptors (Count : word) : word;

Description:

Allocate_ldt_descriptors allocates Count descriptors in the Local Descriptor Table (LDT). The descriptors allocated must be initialized by the application with other function calls.

The function returns a base descriptor with a limit and size value set to zero.

Notes:

Errors:

None.

See also:

SetSegmentBaseAddress, SetSegmentLimit, GetLinearAddr, FreeLdtDescriptor, GetNextSelectorIncrementValue

Example
uses go32;

var VGAsel : word;
    r : trealregs;

begin
  {...}
  r.realeax := $13; realintr($10, r); 
  { set VGA mode }
  {...}
  VGAsel := allocate_ldt_descriptors(1); 
  { allocate one descriptor to the VGA }
  set_segment_base_address(VGAsel, 
                           get_linear_address($A0000,
                           $FFFF)); 
  { set the base address to the VGA }
  set_segment_limit(VGAsel, $FFFF); 
  { set the limit of the descriptor }
  {...}
  seg_fillchar(VGAsel, 100*320+6, 1, 15); 
  { put a pixel at (6/100) in color 15 }
  readln;
  {...}
  free_ldt_descriptor(sel);
  r.realeax := $3; realintr($10, r); 
  { set textmode again }
  {...}
end.



Michael Van Canneyt
Tue Mar 31 16:46:10 CEST 1998